home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 039a / tclib20.zip / DOSHK.H < prev    next >
C/C++ Source or Header  |  1988-12-03  |  2KB  |  53 lines

  1. /* TCHK 2.0 - Howard Kapustein's Turbo C library       12-3-88 */
  2. /* Copyright (C) 1988, Howard Kapustein.  All rights reserved. */
  3.  
  4. /* doshk.h  -  header file for DOSHK.C - DOS routines */
  5.  
  6. #ifndef DOSHK_HEADER
  7. #define DOSHK_HEADER    1
  8.  
  9. #include <howard.h>
  10.  
  11. typedef struct BIOSParmBlock {
  12.             unsigned int BytesPerSector;         /* bytes per sector */
  13.             byte         SectorsPerAllocUnit;    /* sectors per cluster */
  14.             unsigned int ReservedSectors;        /* reserved sectors (for boot record) */
  15.             byte         numberFATs;             /* number of FAT copies */
  16.             unsigned int numberRootDirEntries;   /* number of root directory entries */
  17.             unsigned int TotalSectors;           /* total number of sectors */
  18.             byte         MediaDescriptor;        /* media desriptor byte */
  19.             unsigned int SectorsPerFAT;          /* sectors per FAT */
  20.         };
  21.  
  22. typedef struct BootBlock {
  23.             byte JumpInstr[3];
  24.             byte OEMinfo[9];
  25.             struct BIOSParmBlock BPB;
  26.             unsigned int SectorsPerTrack;        /* sectors per track */
  27.             unsigned int numberHeads;            /* number of heads (sides) */
  28.             unsigned int numberHiddenSectors;    /* number of hidden sectors */
  29.         };
  30.  
  31. /* function prototypes */
  32. boolean getBPB(int drive, struct BIOSParmBlock *BPB);    /* get BIOS Parameter Block (A=0, B=1,...) */
  33. boolean getBootBlock(int drive, struct BootBlock *BB);   /* get Boot Block */
  34. int memory_strategy(boolean read, int *strategy);        /* get/set mem alloc strategy */
  35. boolean isAssignavail(void);                /* is ASSIGN installed */
  36. boolean isAppendavail(void);                /* is APPEND installed */
  37. boolean isVidclock(void);                   /* is VIDCLOCK.COM installed */
  38. int isShareavail(void);                     /* is SHARE installed */
  39.  
  40. #ifndef DOSHK_DEFINES
  41. #define doshour(h)          ((h & 0xF800) >> 11)
  42. #define dosmin(m)           ((m & 0x07E0) >> 5)
  43. #define dossec(s)           (s & 0x001F)
  44. #define todostime(h,m,s)    (((h << 11) & 0xF800) | ((m << 5) & 0x07E0) | (s & 0x001F))
  45. #define dosyear(y)          ((y & 0xFE00) >> 9)
  46. #define dosmonth(m)         ((m & 0x01E0) >> 5)
  47. #define dosday(d)           (d & 0x001F)
  48. #define todosdate(y,m,d)    (((y << 9) & 0xFE00) | ((m << 5) & 0x01E0) | (d & 0x001F))
  49. #define DOSHK_DEFINES   1
  50. #endif
  51.  
  52. #endif              /* DOSHK_HEADER */
  53.